package org.travel.travel2gether.config;

import org.springframework.context.annotation.*;
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;

@Configuration
@ComponentScan(basePackages = { "org.travel.travel2gether" })
public class RootConfig {
	
	@Bean
	public static PropertyPlaceholderConfigurer propertyPlaceholderConfigurer() {
		PropertyPlaceholderConfigurer ppc = new PropertyPlaceholderConfigurer();
		Resource[] resources = new ClassPathResource[4];
		resources[0] = new ClassPathResource("/persistence.properties");
		resources[1] = new ClassPathResource("/facebook.properties");
		resources[2] = new ClassPathResource("/ValidationMessages.properties");
		resources[3] = new ClassPathResource("/application.properties");
		ppc.setLocations(resources);
		return ppc;
	}
	
}